home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / term43-source.lha / Extras / Source / gtlayout-Source.lha / LTP_SizeDimensions.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-18  |  1.4 KB  |  78 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1994 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. */
  6.  
  7. #include "gtlayout_global.h"
  8.  
  9. ULONG __regargs
  10. LTP_GetSizeWidth(struct LayoutHandle *handle)
  11. {
  12.     Object    *SizeImage;
  13.     ULONG     SizeWidth;
  14.     UWORD     SizeType;
  15.  
  16.     if(handle -> Screen -> Flags & SCREENHIRES)
  17.     {
  18.         SizeWidth    = 18;
  19.         SizeType    = SYSISIZE_MEDRES;
  20.     }
  21.     else
  22.     {
  23.         SizeWidth    = 13;
  24.         SizeType    = SYSISIZE_LOWRES;
  25.     }
  26.  
  27.     if(SizeImage = NewObject(NULL,SYSICLASS,
  28.         SYSIA_Size,    SizeType,
  29.         SYSIA_Which,    SIZEIMAGE,
  30.         SYSIA_DrawInfo,    handle -> DrawInfo,
  31.     TAG_DONE))
  32.     {
  33.         GetAttr(IA_Width,SizeImage,&SizeWidth);
  34.  
  35.         DisposeObject(SizeImage);
  36.     }
  37.  
  38.     if(SizeWidth < handle -> Screen -> WBorRight)
  39.         return(handle -> Screen -> WBorRight);
  40.     else
  41.         return(SizeWidth);
  42. }
  43.  
  44. ULONG __regargs
  45. LTP_GetSizeHeight(struct LayoutHandle *handle)
  46. {
  47.     Object    *SizeImage;
  48.     ULONG     SizeHeight;
  49.     UWORD     SizeType;
  50.  
  51.     if(handle -> Screen -> Flags & SCREENHIRES)
  52.     {
  53.         SizeHeight    = 10;
  54.         SizeType    = SYSISIZE_MEDRES;
  55.     }
  56.     else
  57.     {
  58.         SizeHeight    = 11;
  59.         SizeType    = SYSISIZE_LOWRES;
  60.     }
  61.  
  62.     if(SizeImage = NewObject(NULL,SYSICLASS,
  63.         SYSIA_Size,    SizeType,
  64.         SYSIA_Which,    SIZEIMAGE,
  65.         SYSIA_DrawInfo,    handle -> DrawInfo,
  66.     TAG_DONE))
  67.     {
  68.         GetAttr(IA_Height,SizeImage,&SizeHeight);
  69.  
  70.         DisposeObject(SizeImage);
  71.     }
  72.  
  73.     if(SizeHeight < handle -> Screen -> WBorBottom)
  74.         return(handle -> Screen -> WBorBottom);
  75.     else
  76.         return(SizeHeight);
  77. }
  78.